#include"calcualtor.hpp"

#include"TCPServer.hpp"

int main(int argc,char * argv[])
{
    if(argc!=2)
    {
        cout<<"server serverport"<<endl;
        return 1;
    }
    Calculator cal;

    TcpServer server(stoi(argv[1]));

    server.InitServer();//初始化

    server.Registration([&cal](const int left,const char opera,const int right,int& result)
    {
        return cal.Calculate(left,opera,right,result);
    });//注册

    server.Start();//启动

    server.Stop();

    return 0;
}